<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改服务商申请')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-agentInfo-edit">
            <h4 class="form-header h4" >申请服务商信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label  is-required">营销总监编号：</label>
                    <div class="col-sm-8">
                        <input name="topAgentNum" onclick="selectAgentInfoListData()" readonly id="applyAgentNum" type="text" class="form-control" required>
                        <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">营销总监名称：</label>
                    <div class="col-sm-8">
                        <input name="topAgentName" class="form-control" id="applyAgentName" type="text" required readonly>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >奖励设置信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label">返现类型：</label>
                    <div class="col-sm-6" >
                        <label  class="checkbox-inline"> <input type="checkbox"  name="fxEight" value="1"/> 营销奖励 </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--
                        <label  class="checkbox-inline"> <input type="checkbox"  name="fxYsf" value="2"/> 云闪付奖励</label>
-->
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">到期时间：</label>
                    <div class="col-sm-8">
                        <select name="endDate" readonly  class="form-control" >
                            <option value="1">1个月</option>
                            <option value="3">3个月</option>
                            <option value="6">6个月</option>
                            <option value="9">9个月</option>
                            <option value="12">12个月</option>
                        </select>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4" >返现奖励目标信息</h4>
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-3 control-label  is-required">返现奖励服务商编号：</label>
                    <div class="col-sm-8">
                        <input name="agentNum" onclick="selectAgentInfoRecursiveData()" readonly id="targetAgentNum" type="text" class="form-control" >
                        <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">返现奖励服务商名称：</label>
                    <div class="col-sm-8">
                        <input name="agentName" class="form-control" id="targetAgentName" type="text"  readonly>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">上级服务商编号：</label>
                    <div class="col-sm-8">
                        <input name="onAgentNum"  id="onAgentNum" readonly="readonly" class="form-control" type="text">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">上级服务商名称：</label>
                    <div class="col-sm-8">
                        <input name="onAgentName" id="onAgentName"  readonly="readonly" class="form-control" type="text">
                    </div>
                </div>

            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: utils-js" />
    <script th:inline="javascript">
        var prefixA= ctx + "AgentMarketingReward/AgentMarketingReward";

        $("#form-agentInfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefixA + "/addReward", $("#form-agentInfo-edit").serialize());
            }
        }
        
        
        function gradeInfo() {
                $.modal.open("选择档位", ctx + "agentInfo/agentInfo/dwOpen","1100","500");
        }


        /**
         * 选择V9代理
         */
        function selectAgentInfoListData() {
            var url =prefixA+ "/selectAgentInfoList";
            $.modal.open("选择下级服务商" , url, '1100',"500");
        }



        /**
         * 选择本级级以下代理
         */
        function selectAgentInfoRecursiveData() {
            var agentNum = $("#applyAgentNum").val();
            if ($.common.isEmpty(agentNum)){
                $.modal.alertWarning("请选择申请资深总监");
                return;
            }
            var url =prefixA+ "/selectAgentInfoRecursive?agentNum="+agentNum;
            $.modal.open("选择下级服务商" , url, '1100',"500");
        }

    </script>
</body>
</html>